package com.jhh.pay.center.api;

import com.jhh.pay.center.cfg.GlobalConfigProperties;
import com.jhh.pay.center.model.TradeState;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author tangxd
 * @Description: TODO
 * @date 2017/12/1
 */
public abstract class AbstractController {

    @Autowired
    protected GlobalConfigProperties config;

    protected final static int SECOND_INT_LENGTH = 10;

    protected TradeState getState(TradeState state) {
        switch (state) {
            case ERROR:
                return TradeState.ERROR;
            case SUCCESS:
                return TradeState.SUCCESS;
            default:
            case PROGRESSING:
                return TradeState.PROGRESSING;
        }
    }
}
